home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / src / xconq-7.1.0 / mac / macimf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-07  |  2.6 KB  |  68 lines  |  [TEXT/R*ch]

  1. /* Definitions of Mac-specific data about image families in Xconq.
  2.    Copyright (C) 1992, 1993, 1994, 1995 Stanley T. Shebs.
  3.  
  4. Xconq is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.  See the file COPYING.  */
  8.  
  9. /* Structure containing the Mac-specific parts of an image in an image family. */
  10.  
  11. typedef struct a_mac_image {
  12.     Image *generic;                    /* pointer back to generic image */
  13.     int patdefined;                    /* true if mono pattern data is defined */
  14.     Pattern monopat;                /* mono pattern data */
  15.     Handle monosicn;                /* 16x16 mono icon */
  16.     Handle masksicn;                /* 16x16 mask icon */
  17.     Handle monoicon;                /* 32x32 mono icon */
  18.     Handle maskicon;                /* 32x32 mask icon */
  19.     Handle colricon;                /* color icon (can be any size) */
  20.     PixPatHandle colrpat;            /* color pattern (can be 8x8 up to 64x64) */
  21.     /* (should implement all of the following) */
  22.     PicHandle monopict;                /* mono picture */
  23.     PicHandle colrpict;                /* color picture */
  24.     PicHandle maskpict;                /* mask picture */
  25.     PicHandle groupmonopict;        /* mono group picture */
  26.     PicHandle groupcolrpict;        /* color group picture */
  27.     PicHandle groupmaskpict;        /* mask group picture */
  28.     int groupmonox, groupmonoy;        /* Position of mono image in a group picture */
  29.     int groupcolrx, groupcolry;        /* Position of mono image in a group picture */
  30.     int groupmaskx, groupmasky;        /* Position of mono image in a group picture */
  31. } MacImage;
  32.  
  33. #ifdef MPW_C
  34. /* dangerous way */
  35. #define SET_IMG_PAT(mimg,i,val) ((mimg)->monopat[(i)] = (val))
  36. #define IMG_PAT(mimg) ((unsigned char *) &((mimg)->monopat))
  37. #define QD_PAT_ADDR(p) ((unsigned char *) p)
  38. #endif
  39.  
  40. #ifdef THINK_C
  41. /* dangerous way */
  42. #define SET_IMG_PAT(mimg,i,val) ((mimg)->monopat[(i)] = (val))
  43. #define IMG_PAT(mimg) ((unsigned char *) &((mimg)->monopat))
  44. #define QD_PAT_ADDR(p) ((unsigned char *) p)
  45. #endif
  46.  
  47. #ifdef __MWERKS__
  48. #define SET_IMG_PAT(mimg,i,val) (((mimg)->monopat.pat)[(i)] = (val))
  49. #define IMG_PAT(mimg) (&((mimg)->monopat))
  50. #define QD_PAT_ADDR(p) ((unsigned char *) (p.pat))
  51. #endif
  52.  
  53. #define c2p(STR,PBUF) \
  54.   strcpy(((char *) PBUF) + 1, STR);  \
  55.   PBUF[0] = strlen(STR);
  56.  
  57. #define p2c(PSTR,BUF)  \
  58.   strncpy(BUF, ((char *) (PSTR) + 1), PSTR[0]);  \
  59.   BUF[PSTR[0]] = '\0';
  60.  
  61. extern MacImage *init_mac_image(Image *img);
  62. extern MacImage *get_mac_image(Image *img);
  63. extern void mac_load_imf(ImageFamily *imf);
  64. extern void mac_interp_imf(ImageFamily *imf);
  65. extern void mac_interp_bytes(Obj *datalist, int numbytes, Handle desthandle, int jump);
  66. extern void make_generic_image_data(ImageFamily *imf);
  67. extern void mac_load_image_color(ImageColor *imc);
  68.